<?php
/* ========== ########## ========== ########## ========== ########## ========== */
/*                                                                              */
/*   WHMCS v4.1.2 NULLED R4 by FLIPMODE  [ BAD SYNTAX ]                         */
/*                                                                              */
/*                             INTERNAL BAD SYNTAX NULLED VERSION: 2.5.9.6 R4   */
/*                                                                              */
/*   ALL files have been analysed, cleaned and nulled of:                       */
/*     - Call Backs  (100%)                                                     */
/*     - Link Backs (95%)                                                       */
/*     - Licensing  (100%)                                                      */
/*     - Remote Links + URL's                                                   */
/*                                                                              */
/*   WHMCS v4.1.2 RELEASED: 4th November 2009                                   */
/*    -> FIRST v4.1.2 NULL R1: 19th November 2009                               */
/*    -> UPDATED v4.1.2 NULL R4: 27th November 2009                             */
/*                                                                              */
/*   TESTING + VERIFICATION::                                                   */
/*     Files Cleaned, Nulled, Checked, Verified By:                             */
/*      -> FLIPMODE!                                                            */
/*     Decoded By:                                                              */
/*      -> FLIPMODE! + Unknown Decoder                                          */
/*     Tested By:                                                               */
/*      -> FLIPMODE!, LeetWolf, and 12 Anonymous Users...                       */
/*     WHMCS 4.1.2 Supplied By:                                                 */
/*      -> WHM CompleteShit Coder @ WHMCS.com                                   */
/*                                                                              */
/*                                                                              */
/*   IMPORTANT NOTE::                                                           */
/*   PLEASE NOTE THIS IS FOR TRIAL PURPOSES ONLY!                               */
/*                          LIKE IT? THEN BUY IT!                               */
/*                                                                              */
/* ========== ########## ========== ########## ========== ########## ========== */

define ('CLIENTAREA', true);
require 'dbconnect.php';
require 'includes/functions.php';
require 'includes/clientareafunctions.php';
require 'includes/clientfunctions.php';
require 'includes/customfieldfunctions.php';
if (($CONFIG['CaptchaSetting'] == 'on' OR ($CONFIG['CaptchaSetting'] == 'offloggedin' AND !$_SESSION['uid'])))
{
	$capatacha = 'on';
}

$securityquestions = getsecurityquestions ('');
if ($register)
{
	$errormessage = checkdetailsarevalid ($firstname, $lastname, $email, $address1, $city, $state, $postcode, $phonenumber, $password, $password2);
	$errormessage .= checkcustomfields ($customfield);
	if (!$password)
	{
		$errormessage .= '<li>' . $_LANG['ordererrorpassword'];
	}
	else
	{
		$errormessage .= checkpasswordstrength ($password);
	}

	if (($securityquestions AND !$securityqans))
	{
		$errormessage .= '<li>' . $_LANG['securityanswerrequired'];
	}

	if (($capatacha AND $_SESSION['image_random_value'] != md5 (strtoupper ($code))))
	{
		$errormessage .= '<li>' . $_LANG['clientregisterverifyinvalid'];
	}

	if (($CONFIG['EnableTOSAccept'] == 'on' AND $accepttos != 'on'))
	{
		$errormessage .= '<li>' . $_LANG['ordererroraccepttos'];
	}

	if (!$errormessage)
	{
		$userid = addclient ($firstname, $lastname, $companyname, $email, $address1, $address2, $city, $state, $postcode, $country, $phonenumber, $password, $securityqid, $securityqans);
		savecustomfields ($userid, $customfield);
		header ('Location: clientarea.php');
		exit ();
	}
}

$pagetitle = $_LANG['clientregistertitle'];
$breadcrumbnav = '<a href="index.php">' . $_LANG['globalsystemname'] . '</a> > <a href="register.php">' . $_LANG['clientregistertitle'] . '</a>';
$pageicon = 'images/order_big.gif';
initialiseclientarea ($pagetitle, $pageicon, $breadcrumbnav);
$templatefile = 'clientregister';
if (!$CONFIG['AllowClientRegister'])
{
	$smarty->assign ('noregistration', true);
}

include 'includes/countries.php';
$countriesdropdown = getcountriesdropdown ($country);
$smarty->assign ('errormessage', $errormessage);
$smarty->assign ('clientfirstname', $firstname);
$smarty->assign ('clientlastname', $lastname);
$smarty->assign ('clientcompanyname', $companyname);
$smarty->assign ('clientemail', $email);
$smarty->assign ('clientaddress1', $address1);
$smarty->assign ('clientaddress2', $address2);
$smarty->assign ('clientcity', $city);
$smarty->assign ('clientstate', $state);
$smarty->assign ('clientpostcode', $postcode);
$smarty->assign ('clientcountriesdropdown', $countriesdropdown);
$smarty->assign ('clientphonenumber', $phonenumber);
$smarty->assign ('securityquestions', $securityquestions);
$customfields = getcustomfields ('client', '', '', '', 'on', $customfield);
$smarty->assign ('customfields', $customfields);
$smarty->assign ('capatacha', $capatacha);
$smarty->assign ('accepttos', $CONFIG['EnableTOSAccept']);
$smarty->assign ('tosurl', $CONFIG['TermsOfService']);
outputclientarea ($templatefile);
?>